package cc.atliberty.creating.lazysingleton;

/**
 * @Author 元宵
 * @url www.atliberty.cc
 * @Date 2023-10-30 18:00
 * @description: 懒汉式单例类
 */
public class LazySingleton {
    private static LazySingleton INSTANCE = null;
    private LazySingleton(){}
    
    synchronized public static LazySingleton getInstance() {
        if (INSTANCE == null) {
            INSTANCE =  new LazySingleton();
        } 
        return INSTANCE;
    }
}
